Project Overview :
● NumPy is an essential module for carrying out data science operations efficiently.
● NumPy stands for Numerical Python.
● Percentile function of numpy used to compute the nth percentile of the given data (array elements) along the specified axis.
Syntax : numpy.percentile()
Requirements :
● Python
● VS code
● Library – numpy
Code :
import numpy ages = [5,31,43,48,50,41,7,11,15,39,80,82,32,2,8,6,25,36,27,61,31] x = numpy.percentile(ages,75) print("Percentile: ", x)
Code Explanation :
● import numpy ->import numpy as np and use it in python. In command prompt or VS code terminal run the below pip command to install numpy library,
● pip3 install numpy # For Python version 3
● ages = [5,31,43,48,50,41,7,11,15,39,80,82,32,2,8,6,25,36,27,61,31]
● Array of the ages of people
● x = numpy.percentile(ages,75) -> Find the percentile of the array, here we will mentioned 75th percentile.
● print("Percentile: ", x)
● Run the code.
Output :
●After running the code, output of the terminal as given below,